package com.xdclass.userapp.controller;

import com.xdclass.userapp.model.domain.TUser;
import com.xdclass.userserviceapi.service.UserService;
import com.xdclass.userserviceapi.vo.UserVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author whg
 * @create 2023/7/10 14:59
 * @description：
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;


    /**
     * 通过用户ID得到用户信息
     * @param id
     * @return
     */
    @RequestMapping("getUserById")
    public Object getUserById(@RequestParam("id") Integer id){
        if (null == id || 0 == id){
            return null;
        }
        return userService.getUserById(id);
    }
}
